package com.yipinhouse.backstage.app.apiImpl;

import cn.hutool.core.bean.BeanUtil;
import com.yipinhouse.backstage.client.SigningMessageWebClient;
import com.yipinhouse.backstage.client.param.DoSigningWebParam;
import com.yipinhouse.common.result.Result;
import com.yipinhouse.signing.client.SigningManageClient;
import com.yipinhouse.signing.client.param.DoSigningParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
@Slf4j
@RestController
@RequestMapping("backstage")
public class SigningMessageWebApiImpl implements SigningMessageWebClient {

    @Resource
    private SigningManageClient signingManageClient;

    @Override
    public Result doSigning(DoSigningWebParam param) {
        DoSigningParam doSigningParam = BeanUtil.copyProperties(param, DoSigningParam.class);
        Result result = signingManageClient.doSigning(doSigningParam);
        return result;
    }
}
